﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BHair.Base
{
    public partial class frmcheckpwd : Form
    {
        public frmcheckpwd()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //判断卡密码
            chuanzhi ca = new chuanzhi();
            if (ca.checkcardpwd(textBox1.Text) == true)
            {
                chuanzhi.ifpwd = 1;
                this.Close();
            }
            else
            {
                MessageBox.Show("密码错误！");
                chuanzhi.ifpwd = 0;
            }
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                //判断卡密码
                chuanzhi ca = new chuanzhi();
                if (ca.checkcardpwd(textBox1.Text) == true)
                {
                    chuanzhi.ifpwd = 1;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("密码错误！");
                    chuanzhi.ifpwd = 0;
                }
            }
        }
    }
}
